home *** CD-ROM | disk | FTP | other *** search
- /* virtual.rexx 1.0 (20.7.2000) */
-
- signal on halt
- signal on break_c
-
- call init
- call CreateApp
- call HandleApp
- /* never reached */
- /***********************************************************************/
- init: procedure
- l="rmh.library";if ~show("L",l) then;if ~AddLib(l,0,-30) then exit
- if AddLibrary("rxmui.library")~=0 then exit
- return
- /***********************************************************************/
- MakePage1: procedure
-
- text1=ParseText("
- %iHello User !%n\n
- \n
- This could be a very long text and you are looking\n
- at it through a %uvirtual group%n. Please use the\n
- scrollbars at the right and bottom of the group to\n
- move the visible area either vertically or\n
- horizontally. While holding down the small arrow\n
- button between both scrollbars, the display will\n
- follow your mouse moves.\n
- \n
- If you click somewhere into a %uvirtual group%n and\n
- move the mouse across one of its borders, the group will\n
- start scrolling. If you are lucky and own a middle mouse\n
- button, you may also want to press it and try moving.\n
- \n
- When the surrounding window is big enough for the\n
- complete virtual group to fit, the scrollers and\n
- the move button get disabled.\n
- \n
- Since this %uvirtual group%n does only contain a\n
- single text object, it's a rather simple example.\n
- In fact, virtual groups are a lot more powerful,\n
- they can contain any objects you like.\n
- \n
- Note to 7MHz/68000 users: Sorry if you find this\n
- thingy a bit slow. Clipping in virtual groups can\n
- get quite complicated. Please don't blame me,\n
- blame your 'out of date' machine! :-)\n
- \n
- %i%cHave fun, Stefan.%n%l\n
- \n
- %uNote From %ialfie%n:\n
- in %bRxMUI%n version < 2.4, a virtual group with a\n
- frame shows its frame twice.\n")
-
- v.frame="virtual"
- v.UseWinBorder=1
- v.0="t0"
- t0.class="text"
- t0.background="textback"
- t0.contents=text1
-
- res=NewObj("scrollgroup","page1","v")
- if res~=0 then call err(res)
-
- return "page1"
- /***********************************************************************/
- MakePage2: procedure
-
- text2=ParseText("
- %cAs you can see, this virtual group contains a\n
- lot of different objects. The (virtual) width\n
- and height of the virtual group are automatically\n
- calculated from the default width and height of\n
- the virtual groups contents.")
-
- v.frame="virtual"
-
- v.0="t1"
- t1.class="text"
- t1.frame="text"
- t1.background="textback"
- t1.contents=text2
-
- v.1="g0"
- g0.class="group"
- g0.horiz=1
- g0.0="g1"
- g1.class="group"
- g1.columns=2
- g1.frame="group"
- g1.FrameTitle="Images"
- do i=0 to 9
- g1.i="im"i;
- interpret "IM"i".CLASS=image"
- interpret 'IM'i'.SPEC='i+11
- end
- g0.1="g2"
- g2.class="group"
- g2.frame="group"
- g2.FrameTitle="Backgrounds"
- g2.0="g3"
- g3.class="group"
- g3.horiz=1
- g3.0="rec0"
- rec0.class="rectangle"
- rec0.frame="text"
- rec0.background="background"
- rec0.FixWidth=30
- g3.1="rec1"
- rec1.class="rectangle"
- rec1.frame="text"
- rec1.background="fill"
- rec1.FixWidth=30
- g3.2="rec2"
- rec2.class="rectangle"
- rec2.frame="text"
- rec2.background="shadow"
- rec2.FixWidth=30
- g2.1="g4"
- g4.class="group"
- g4.horiz=1
- g4.0="rec3"
- rec3.class="rectangle"
- rec3.frame="text"
- rec3.background="shadowback"
- rec3.FixWidth=30
- g4.1="rec4"
- rec4.class="rectangle"
- rec4.frame="text"
- rec4.background="shadowfill"
- rec4.FixWidth=30
- g4.2="rec5"
- rec5.class="rectangle"
- rec5.frame="text"
- rec5.background="shadowshine"
- rec5.FixWidth=30
- g2.2="g5"
- g5.class="group"
- g5.horiz=1
- g5.0="rec6"
- rec6.class="rectangle"
- rec6.frame="text"
- rec6.background="fillback"
- rec6.FixWidth=30
- g5.1="rec7"
- rec7.class="rectangle"
- rec7.frame="text"
- rec7.background="shineback"
- rec7.FixWidth=30
- g5.2="rec8"
- rec8.class="rectangle"
- rec8.frame="text"
- rec8.background="fillshine"
- rec8.FixWidth=30
-
- v.2="g6"
- g6.class="group"
- g6.frame="group"
- g6.columns=2
- g6.0=label("Gauge")
- g6.1="gauge"
- gauge.class="gauge"
- gauge.frame="gauge"
- gauge.horiz=1
- gauge.current=66
- g6.2=VSpace(0)
- g6.3=MakeObj(,"scale")
-
- v.3="sch"
- sch.class="scrollgroup"
- sch.Frame="group"
- sch.FrameTitle="Virtual in virtual"
- sch.virtgroupcontents="vgh"
- vgh.class="virtgroup"
- vgh.frame="virtual"
- vgh.0=button("zero","zero")
- vgh.1=button("one","one")
- vgh.2=button("two","two")
- vgh.3=button("three","three")
- vgh.4=button("four","four")
- vgh.5=button("five","five")
-
- res=NewObj("scrollgroup","page2","v")
- if res~=0 then call err(res)
-
- return "page2"
- /***********************************************************************/
- HandleApp: procedure expose global.
- ctrl_c=2**12
- do forever
- call NewHandle("APP","H",ctrl_c)
- if and(h.signals,ctrl_c)>0 then exit
- select
- when h.event="QUIT" then exit
- otherwise nop
- end
- end
- /***********************************************************************/
- CreateApp: procedure expose global.
-
- app.title="VirtualDemo"
- app.version="$VER: VirtualDemo 1.0 (20.7.2000)"
- app.copyright="©2000, alfie"
- app.author="alfie"
- app.description="Show virtual groups."
- app.base="VIRTUALDEMO"
- app.SubWindow="mwin"
-
- mwin.title="Virtual Groups"
- mwin.ID="VIRT"
- mwin.UseRightBorderScroller=1
- mwin.UseBottomBorderScroller=1
- mwin.contents="mgroup"
-
- mgroup.class="register"
- mgroup.Titles="Page1|Page2"
- mgroup.0=MakePage1()
- mgroup.1=MakePage2()
-
- res=NewObj("application","app")
- if res~=0 then call err(res)
-
- call notify("mwin","CloseRequest",1,"app","ReturnID","quit")
-
- call set("mwin","open",1)
- call getattr("mwin","open","o")
- if o=0 then do
- say "can't open window"
- exit
- end
-
- return
- /***********************************************************************/
- halt:
- break_c:
- exit
- /**************************************************************************/
- err: procedure expose sigl RxMUIError
- parse arg res
- msg = ProgramName()":" GetRxMUIString(res) "in line" sigl-1
- if RxMUIError~="RXMUIERROR" then msg = msg "["RxMUIError"]"
- say msg
- exit
- /**************************************************************************/
-